		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<script src="/javascript/jquery.alerts.js" type="text/javascript"></script>
		<script type="text/javascript" src="/javascript/jquery.tooltip.execute.js"></script>
		<script type="text/javascript" src="/javascript/jquery.tooltip.v.1.1.js"></script>
		<link href="/stylesheets/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
	    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
		<script type="text/javascript">
		// Load google visualization API 
			google.load('visualization', '1', {packages: ['table','columnchart']});

			function drawVisualization() {


				{% if HaveArenaOrNot %}

				var visualization, visualization2;
				comp_title = "How Users vote for "
				
				// Competitions list table		
				var data = new google.visualization.DataTable();
				data.addColumn('string', 'Competition Name');
				data.addColumn('number', 'Participates No.');	        
				data.addColumn('number', 'Investment Amount');
				data.addColumn('string', 'Start Date');
				data.addColumn('string', 'End Date');
				{{ competition_table_Text }}
				

				
				visualization = new google.visualization.Table(document.getElementById('table'));
				visualization.draw(data, {'allowHtml':true,'width':750,'page':'enable','sortColumn':4,'sortAscending':false});
				
				{% endif %}

				{% if bool %}
				// Competition graph table				
				var data2 = new google.visualization.DataTable();
				data2.addColumn('string', 'Option');
				data2.addColumn('number', 'Participates No.');	        
				{{ competition_graph_Chart }}
				
				visualization2 = new google.visualization.ColumnChart(document.getElementById('table2'));
				visualization2.draw(data2, {width: 700, height: 340, is3D: true, legend:'none',title:'How users vote for "{{ comp_title }}" arena ?', titleFontSize:14, axisFontSize:12});
				{% endif %}
			}

			google.setOnLoadCallback(drawVisualization);
			
			 // JQuery Code
			$(document).ready(function() {
				$("a.toolclass").simpletooltip();						  
				$('#advbuy').submit(function() {
					res=ValidateBuy();
					if (res==0) {
						jAlert("Please insert a valid amount", "Attention");
						return false;
					}
					else return true;
				});
				return false;
			});
			function ValidateBuy() {
				if (!$('#investAmount').val()) return 0;
				else if ($('#investAmount').val()=='' || $('#investAmount').val()!=parseFloat($('#investAmount').val()) || parseFloat($('#investAmount').val())=='0') return 0;
				return 1;
				
			}
					
		</script>	